{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 三角形单元上的任意次 Lagrangian 基函数"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "| 记号 | 意义|\n",
    "|:----- | :-----|\n",
    "| $\\tau$ | 三角形单元 |\n",
    "| $x_i, i= 0, 1, 2$ | $\\tau$ 的三个顶点 |\n",
    "| $e_{ij}$ |以 $x_i$ 和 $x_j$ 为顶点的边 |\n",
    "| $\\lambda_i, i =0, 1, 2$ | 三个顶点对应的重心坐标 |\n",
    "| $ \\mathrm{dof}_p = \\frac{(p+1)(p+2)}{2}$ | $p$ 次多项式的自由度个数 |"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![ The different order dofs on triangle ](./figures/lagrangian_1-12.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 单元 $\\tau$ 上任意 $p$ 次 Lagrangian 基函数的数表示"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "顶点 $x_i$ 上的基函数:\n",
    "$$\n",
    "\\phi_i = \\frac{p^{p}}{p!}\\prod_{l=0}^{p-1}\n",
    "(\\lambda_i - \\frac{l}{p}), \n",
    "$$\n",
    "其中 $i = 1, 2,3$."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "边 $e_{ij}$ 上的基函数: \n",
    "$$\n",
    "\\phi_{ij, m} = \\frac{p^p}{m!(p-m)!}\n",
    "\\prod_{l_1 = 0}^{m-1}(\\lambda_i  - \\frac{l_1}{p})\n",
    "\\prod_{l_2 = 0}^{p-m-1}(\\lambda_j - \\frac{l_2}{p}),\n",
    "$$\n",
    "其中 $1 < i, j < 3, i \\not= j$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "单元 $\\tau$ 内部自由度的基函数:\n",
    "$$\n",
    "\\phi_{ijk,m,n} = \\frac{p^p}{m!n!(p-m-n)!}\\prod_{l_1 = 0}^{m - 1}\n",
    "(\\lambda_i - \\frac{l_1}{p}) \\prod_{l_2 = 0}^{n-1}(\\lambda_j -\n",
    "\\frac{l_2}{p}) \\prod_{l_3=0}^{p-m-n-1}(\\lambda_k - \\frac{l_3}{p}).\n",
    "$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 函数值的递归算法 "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "记\n",
    "$$\n",
    "A :=                                                                            \n",
    "\\begin{pmatrix}                                                                 \n",
    "\\lambda_1 & \\lambda_2 & \\lambda_3\\\\                                             \n",
    "\\lambda_1 - \\frac{1}{p} & \\lambda_2 - \\frac{1}{p} & \\lambda_3 - \\frac{1}{p}\\\\   \n",
    "\\vdots & \\vdots & \\vdots \\\\                                                     \n",
    "\\lambda_1 - \\frac{p - 1}{p} & \\lambda_2 - \\frac{p - 1}{p} & \\lambda_3 - \\frac{p - 1}{p}\n",
    "\\end{pmatrix}                                                                   \n",
    "$$  \n",
    "\n",
    "$$\n",
    "P = \n",
    "\\begin{pmatrix}\n",
    "\\frac{1}{1!} & 0 & \\cdots & 0\\\\\n",
    "0 & \\frac{1}{2!} & \\cdots & 0\\\\\n",
    "\\vdots & \\vdots & \\ddots & 0 \\\\\n",
    "0 & 0 & \\cdots & \\frac{1}{p!}\n",
    "\\end{pmatrix}\n",
    "$$\n",
    "\n",
    "\n",
    "$\\alpha_0 = 1$, $\\beta_0 = 1$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 递归 算法"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$$\n",
    "A = \n",
    "\\begin{pmatrix}                                                                 \n",
    "\\lambda_0 - \\frac{0}{7} & \\lambda_1 - \\frac{0}{7} & \\lambda_2  -\n",
    "\\frac{0}{7}\\\\                                             \n",
    "\\lambda_0 - \\frac{1}{7} & \\lambda_1 - \\frac{1}{7} & \\lambda_2 - \\frac{1}{7}\\\\   \n",
    "\\lambda_0 - \\frac{2}{7} & \\lambda_1 - \\frac{2}{7} & \\lambda_2 - \\frac{2}{7}\\\\    \n",
    "\\lambda_0 - \\frac{3}{7} & \\lambda_1 - \\frac{3}{7} & \\lambda_2 - \\frac{3}{7}\\\\ \n",
    "\\lambda_0 - \\frac{4}{7} & \\lambda_1 - \\frac{4}{7} & \\lambda_2 - \\frac{4}{7}\\\\ \n",
    "\\lambda_0 - \\frac{5}{7} & \\lambda_1 - \\frac{5}{7} & \\lambda_2 - \\frac{5}{7}\\\\ \n",
    "\\lambda_0 - \\frac{6}{7} & \\lambda_1 - \\frac{6}{7} & \\lambda_2 - \\frac{6}{7}\\\\ \n",
    "\\end{pmatrix}\n",
    "$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " **第 0 层** "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$\\alpha = 1$ \n",
    "\n",
    "$p = 7$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  },
  "latex_envs": {
   "LaTeX_envs_menu_present": true,
   "bibliofile": "biblio.bib",
   "cite_by": "apalike",
   "current_citInitial": 1,
   "eqLabelWithNumbers": true,
   "eqNumInitial": 0
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
